package scr.main.com.tttshaoqi;

import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;
import java.util.stream.Stream;

/**
 * @author tttshaoqi
 * &#064;create 2025-08-16-14:47
 */
public class stream03 {
    public static void main(String[] args) {
        List<Actor> manActors = new ArrayList<>();
        manActors.add(new Actor("张三",25));
        manActors.add(new Actor("李四",25));
        manActors.add(new Actor("张三风",25));
        manActors.add(new Actor("王大锤",25));
        manActors.add(new Actor("行楷宁",25));

        List<Actor> womanActors = new ArrayList<>();
        womanActors.add(new Actor("波多野",25));
        womanActors.add(new Actor("苍井空",25));
        womanActors.add(new Actor("杨泽玛丽",25));
        womanActors.add(new Actor("杨北才华",25));
        womanActors.add(new Actor("杨超越",25));

        Stream<Actor> stream1 = manActors.stream().filter(s -> s.getName().length() == 3)
                .limit(2);
        Stream<Actor> stream2 = womanActors.stream().filter(s -> s.getName().startsWith("杨"));
        List<Actor> collect = Stream.concat(stream1, stream2).collect(Collectors.toList());
        System.out.println(collect);
    }
}
